<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
  <div id = "app">
    <!-- v-if 是将元素从节点下直接删除 -->
    <p v-if = "flag">v-if控制的元素/p>
    <!-- v-show是控制元素的display为none 来让元素隐藏  -->
    <p v-show = "flag">v-show控制的元素</p>
  </div>

  <script>
    const app = new Vue({
      el:"#app",
      data:{
        // 如果flag为true 则显示被控制的元素，为false则隐藏
        flag:true,
      }
    })
  </script>
  </div>
</body>
</html>